//
//  XMTitleModel.m
//  XMFilterView
//
//  Created by mac on 2019/11/27.
//  Copyright © 2019 aishangliguo. All rights reserved.
//

#import "XMTitleModel.h"

// Model
#import "XMNameModel.h"

@implementation XMTitleModel

- (instancetype)initWithTitleDict:(NSDictionary *)dict {
    if (self = [super init]) {
        self.title = dict[@"title"];
        self.name = dict[@"name"];
        NSMutableArray *nameSource = [NSMutableArray arrayWithCapacity:self.name.count];
        for (NSDictionary *nameDict in self.name) {
            XMNameModel *nameModel = [[XMNameModel alloc] initWithNameDict:nameDict];
            [nameSource addObject:nameModel];
        }
        self.name = [nameSource copy];
    }
    return self;
}

@end
